package Model;

import Persistance.BookList;
import Persistance.MovieList;
import Persistance.UserList;

import java.util.ArrayList;

public class Library {

    private BookList bookList;
    private MovieList movieList;
    private UserList userList;

    public Library(BookList bookList,MovieList movieList, UserList userList ){
        this.bookList = bookList;
        this.movieList = movieList;
        this.userList = userList;
    }

    public MovieList getMovieList(){
        return this.movieList;
    }

    public BookList getBookList(){
        return this.bookList;
    }

    public Book reserveBookWithId(int id){
        if(this.bookList.getAvailabilityOfBook(id)){
            this.bookList.setAvailabilityOfBook(id, false);
            return this.bookList.getBookWithID(id);
        }
        else
            return null;
    }

    public int getBookLibrarySize(){
        return this.bookList.size();
    }

    public ArrayList<User> getUserList(){
        return this.userList.getUserList();
    }

}
